package com.gzyj.jtt808.v2019.model.gps.additionalInfo;


import com.gzyj.jtt808.v2011.additionalinfo.JTT808_AddtionalInfo;
import io.netty.buffer.ByteBuf;
import lombok.Data;

import java.io.Serializable;

/**
 * 车厢温度
 * @author lhj
 */
@Data
public class JTT808_0x0200_0x06 extends JTT808_AddtionalInfo implements Serializable {

    private short CarTemperature;

    public JTT808_0x0200_0x06(){
        this.setID(0x06);
        this.setLength(2);
    }

    @Override
    public void encode(ByteBuf buf) {
        buf.writeByte(this.getID());
        buf.writeByte(this.getLength());
        buf.writeShort(this.CarTemperature);
    }

    @Override
    public JTT808_0x0200_0x06 decode(ByteBuf buf) {
        this.setLength(Byte.toUnsignedInt(buf.readByte()));
        this.CarTemperature=buf.readShort();
        return this;
    }
}
